package com.zhongxi.guoyuan.entity.rewardcoin;

import com.zhongxi.guoyuan.entity.BaseResult;
import com.zhongxi.guoyuan.utils.JsonUtils;

import org.json.JSONArray;
import org.json.JSONException;

import java.util.List;

/**
 * Created by Administrator on 2017/2/9.
 */

public class RewardCoinOrderResult {
    private int code;
    private List<RewardCoinOrder> data;
    private BaseResult safeobj;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public List<RewardCoinOrder> getData() {
        return data;
    }

    public void setData(List<RewardCoinOrder> data) {
        this.data = data;
    }

    public BaseResult getSafeobj() {
        return safeobj;
    }

    public void setSafeobj(BaseResult safeobj) {
        this.safeobj = safeobj;
    }

    public void setInfo(JSONArray info) {
        for (int i=0; i<info.length(); i++){
            try {
                data.get(i).setGoodsId(JsonUtils.getData(info.getJSONObject(i).getJSONArray("goodsid")));
                data.get(i).setImg(JsonUtils.getData(info.getJSONObject(i).getJSONArray("thumbnail")));
                data.get(i).setGoodsName(JsonUtils.getData(info.getJSONObject(i).getJSONArray("goodsname")));
                data.get(i).setGoodsNum(JsonUtils.getData(info.getJSONObject(i).getJSONArray("goodsnum")));
                data.get(i).setShouldPrice(JsonUtils.getData(info.getJSONObject(i).getJSONArray("shouldprice")));
                data.get(i).setAttr(JsonUtils.getData(info.getJSONObject(i).getJSONArray("gattr")));
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }

    public class RewardCoinOrder{
        private String orderid;
        private String type;
        private OrderInfo orderInfo;
        private List<String> goodsId;
        private List<String> goodsName;
        private List<String> goodsNum;
        private List<String> img;
        private List<String> shouldPrice;
        private List<String> attr;

        public List<String> getGoodsId() {
            return goodsId;
        }

        public void setGoodsId(List<String> goodsId) {
            this.goodsId = goodsId;
        }

        public List<String> getGoodsName() {
            return goodsName;
        }

        public void setGoodsName(List<String> goodsName) {
            this.goodsName = goodsName;
        }

        public List<String> getGoodsNum() {
            return goodsNum;
        }

        public void setGoodsNum(List<String> goodsNum) {
            this.goodsNum = goodsNum;
        }

        public List<String> getImg() {
            return img;
        }

        public void setImg(List<String> img) {
            this.img = img;
        }

        public List<String> getShouldPrice() {
            return shouldPrice;
        }

        public void setShouldPrice(List<String> shouldPrice) {
            this.shouldPrice = shouldPrice;
        }

        public List<String> getAttr() {
            return attr;
        }

        public void setAttr(List<String> attr) {
            this.attr = attr;
        }

        public String getOrderid() {
            return orderid;
        }

        public void setOrderid(String orderid) {
            this.orderid = orderid;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }


        public OrderInfo getOrderInfo() {
            return orderInfo;
        }

        public void setOrderInfo(OrderInfo orderInfo) {
            this.orderInfo = orderInfo;
        }
    }

    public class OrderInfo {
        private String id;
        private String userid;
        private String shouldprice;
        private String goodsnum;
        private String ctime;
        private String consignee;
        private String consigneemphone;
        private String shippingaddress;
        private String postage;
        private String poststatus;
        private String selfstatus;

        public String getSelfstatus() {
            return selfstatus;
        }

        public void setSelfstatus(String selfstatus) {
            this.selfstatus = selfstatus;
        }

        public String getPoststatus() {
            return poststatus;
        }

        public void setPoststatus(String poststatus) {
            this.poststatus = poststatus;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getUserid() {
            return userid;
        }

        public void setUserid(String userid) {
            this.userid = userid;
        }

        public String getShouldprice() {
            return shouldprice;
        }

        public void setShouldprice(String shouldprice) {
            this.shouldprice = shouldprice;
        }

        public String getGoodsnum() {
            return goodsnum;
        }

        public void setGoodsnum(String goodsnum) {
            this.goodsnum = goodsnum;
        }

        public String getCtime() {
            return ctime;
        }

        public void setCtime(String ctime) {
            this.ctime = ctime;
        }

        public String getConsignee() {
            return consignee;
        }

        public void setConsignee(String consignee) {
            this.consignee = consignee;
        }

        public String getConsigneemphone() {
            return consigneemphone;
        }

        public void setConsigneemphone(String consigneemphone) {
            this.consigneemphone = consigneemphone;
        }

        public String getShippingaddress() {
            return shippingaddress;
        }

        public void setShippingaddress(String shippingaddress) {
            this.shippingaddress = shippingaddress;
        }

        public String getPostage() {
            return postage;
        }

        public void setPostage(String postage) {
            this.postage = postage;
        }
    }
}
